package com.agmte.api.common.crud.core.pojo;

import lombok.Data;

import java.beans.Transient;
import java.util.List;

@Data
public class Page<T> {
    private Class<T> clazz;
    private Integer pageNum;
    private Integer pageSize;
    private Long total;
    private List<T> list;

    public Page(Class<T> clazz, Integer pageNum, Integer pageSize) {
        this.clazz = clazz;
        if (pageNum == null || pageSize == null) {
            throw new IllegalArgumentException("pageNum or pageSize can't be null");
        }
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }
}
